/*
 * @Author: KKKKKK
 * @Date: 2021-01-10 12:08:35
 * @LastEditors: KKKKKK
 * @LastEditTime: 2021-01-10 12:08:35
 */
import axios from './config'
import url from './url'
const baseUrl = process.env.VUE_APP_BASE_URL

/* 轮播图 */
// 新增轮播图
const advertisementCreate = (params) => axios.post(baseUrl + url.advertisement.create, params)

// 删除轮播图
const advertisementDelete = (id) => axios.delete(baseUrl + url.advertisement.delete + `/${id}`)

// 修改轮播图
const advertisementUpdate = (params, id) => axios.post(baseUrl + url.advertisement.update + `/${id}`, params)

// 获取某个轮播图
const advertisementLoad = (id) => axios.get(baseUrl + url.advertisement.load + `/${id}`)

// 获取轮播图列表
const advertisementPage = (params) => axios.get(baseUrl + url.advertisement.page, { params })

export default {
    advertisementCreate,
    advertisementDelete,
    advertisementUpdate,
    advertisementLoad,
    advertisementPage,
}
